 <?
defined( '_JEXEC' ) or die( 'Restricted access' );
?>


<form action="index.php" method="post" name="adminForm">

<div id="editcell">
	<table class="adminlist">
	<thead>
		<tr>
			<th width="5%">
				<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->orders ); ?>);" />
			</th>
			<th width="5%">
				Order id
			</th>
			<th width="15%">
				Date
			</th>
            <th width="15%">
				Name
			</th>
			<th width="15%">
				Address
			</th>
			<th width="15%">
				Phone
			</th>
			<th width="15%">
				Email
			</th>
			<th width="15%">
				Total
			</th>
            <th width="5%">
				Status
			</th>
		</tr>			
	</thead>
	
	<?php
	$k = 0;
	for ($i=0, $n=count( $this->orders ); $i < $n; $i++)
	{		$row = &$this->orders[$i];
		$checked 	 = JHTML::_('grid.id',   $i, $row->order_id );
		?>
		<tr class="<?php echo "row$k"; ?>">
			<td align="center">
				<?php echo $checked; ?>
			</td>
			<td align="center">
				<a href="../index.php?option=com_ecommerce&view=orders&layout=detail&tmpl=component&order_id=<?php echo $row->order_id?>" rel="{handler: 'iframe', size: {x: 780, y: 670}}" class="modal">
				<?php echo sprintf("%06d", $row->order_id); ?>
				</a>
			</td>
			<td align="center">
				<?php echo date("H:i:s d-m-Y",$row->order_date); ?>
			</td>
            <td align="center">
				<?php echo $row->name; ?>
			</td>
			<td align="center">
				<?php echo $row->address; ?>
			</td>			
			<td align="center">
				<?php echo $row->phone; ?> 
			</td>			
			<td align="center">
				<?php echo $row->email; ?> 
			</td>
			<td align="center">
				<?php echo $row->order_total; ?>  DKK
			</td>
             <?php if($row->order_status){ ?>
            <td width="5%" align="center" ><a href="#unPaid" onclick="return listItemTask('cb<?php echo $i;?>','unPaid')"><img border="0" alt="Paid" src="images/tick.png"/></a></td>
            <?php }else{ ?>
            <td width="5%" align="center" ><a href="#paid" onclick="return listItemTask('cb<?php echo $i;?>','paid')"><img border="0" alt="Unpaid" src="images/publish_x.png"/></a></td>
            <?php } ?>
		</tr>
		<?php
		$k = 1 - $k;
	}
	?>
			<tr>
				<td colspan="10">
					<?php echo $this->page->getListFooter(); ?><br />
				</td>
			</tr>
	</table>
</div>

<input type="hidden" name="option" value="com_ecommerce" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="orders" />
</form>